<form method="post" action="/sys/resource/add" enctype="multipart/form-data" class="pageForm required-validate"
      onsubmit="return iframeCallback(this, pageRefresh)">
    <input type="hidden" id="upId" name="upId" th:value="${pid}">
    <input type="hidden" id="systemId" name="systemId" th:value="${sid}">
    <input type="hidden" id="modelId" name="modelId" th:value="${mid}">
    <input type="hidden" id="cmd5" name="cmd5" value="">
    <input type="hidden" id="uid" name="uid" value="">
    <input type="hidden" id="randomData" name="randomData" value="">
    <div class="ibox no-margins no-padding no-borders">
        <div class="ibox-title p-xs ljFixBoxTitle">
            <div class="btn btn-sm btn-primary pull-right" id="btnAddSubmit"><i class="fa fa-paste">添加资源</i></div>
        </div>
        <div style="height:40px;"></div>
        <div class="ibox-content">
            <div class="row">
                <div class="form-group col-md-4">
                    <label>所属系统(<b class="text-danger">*</b>):</label>
                    <input type="text" class="form-control input-sm required" th:value="${sysSystem.systemName}" readonly>
                </div>
                <div class="form-group col-md-4">
                    <label>所属模块(<b class="text-danger">*</b>):</label>
                    <input type="text" class="form-control input-sm required" th:value="${sysModel.modelName}" readonly>
                </div>
                <div class="form-group col-md-4">
                    <label>父资源(<b class="text-danger">*</b>):</label>
                    <input type="text" class="form-control input-sm required" th:value="${resName}" readonly>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="row">
                <div class="form-group col-md-6">
                    <label>资源类型:</label>
                    <select name="resType" data-placeholder="请选择资源类型" class="form-control input-sm chosen-select required" style="width:100%;">
                        <option value="0" hassubinfo="true">0:页面</option>
                        <option value="1" hassubinfo="true">1:菜单</option>
                    </select>
                </div>
                <div class="form-group col-md-6">
                    <label>资源名称(<b class="text-danger">*</b>):</label>
                    <input name="resName" type="text" class="form-control input-sm required" maxlength="32">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-6">
                    <label>资源路径(<b class="text-danger">*</b>):</label>
                    <input name="resUrl" type="text" class="form-control input-sm required" maxlength="128">
                </div>
                <div class="form-group col-md-6">
                    <label>权限编码:</label>
                    <input name="resLimit" type="text" class="form-control input-sm required" maxlength="32">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-6">
                    <label>资源排序:</label>
                    <input name="resSort" type="text" class="form-control input-sm required digits" maxlength="6">
                </div>
                <div class="form-group col-md-6">
                    <label>资源图标:</label>
                    <input name="resIcon" type="text" class="form-control input-sm">
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="row">
                <div class="form-group col-md-6">
                    <label>执行事件:</label>
                    <input name="resEvent" type="text" class="form-control input-sm" maxlength="32">
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-6">
                    <label>IP白名单:</label>
                    <textarea name="resIp" class="form-control input-sm" rows="3"></textarea>
                </div>
                <div class="form-group col-md-6">
                    <label>Session白名单:</label>
                    <textarea name="resSession" class="form-control input-sm" rows="3"></textarea>
                </div>
            </div>
        </div>
    </div>
</form>
<script>
    jQuery(function ($) {
        $(".chosen-select").chosen();
        $("#btnAddSubmit").on("click", function () {
            var values = {};
            modifyVerf(values);
            $("#cmd5").val(values.cmd5);
            $("#uid").val(values.uid);
            $("#randomData").val(values.randomData);
            $(this).closest("form").submit();
        });
    });
</script>